package com.example.doctorserver.service.impl;

import com.example.doctorserver.mapper.CidetailedreportMapper;
import com.example.doctorserver.pojo.Cidetailedreport;
import com.example.doctorserver.service.CiDetailedReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class CiDetailedReportServiceImpl implements CiDetailedReportService {

    @Autowired
    private CidetailedreportMapper cidetailedreportMapper;

    @Override
    public int updateValue(List<Cidetailedreport> arr) {

        for (Cidetailedreport item : arr) {
            Map<String,Object> params = new HashMap<>();

            params.put("orderId", item.getOrderId());
            params.put("cdId", item.getCdId());
            params.put("value", item.getValue());
            params.put("isError", item.getIsError());

            cidetailedreportMapper.updateValue(params);
        }
        return 0;
    }
}
